import { stringify } from 'qs';
import request from '@/utils/request';
import {formDataCode} from '@/utils/utils';


// 获取订单列表
 export async function GetOrderList(params) {
      return request(`/${window.storeId}/Order/GetOrderList?${stringify(params)}`);
}

// 获取备注
export async function GetOrderTag(params) {
    return request(`/${window.storeId}/Order/GetOrderTag?${stringify(params)}`);
}

// 获取今日剩余导出次数和任务名称
export async function GetTaskName(params) {
    return request(`/${window.storeId}/Task/GetTaskName?${stringify(params)}`);
}

// 获取导出任务列表
export async function GetTaskList(params) {
    return request(`/${window.storeId}/Task/GetTaskList?${stringify(params)}`);
}

//获取调价页商品信息
export async function FindOrderItemFeeByOrderNo(params) {
    return request(`/${window.storeId}/Order/FindOrderItemFeeByOrderNo?${stringify(params)}`);
}

// 修改备注
export async function SetOrderTag(params) {
    return request(`/${window.storeId}/Order/SetOrderTag`, {
      method: 'POST',
      headers:{
        'Content-Type':"application/x-www-form-urlencoded",        
     },
     body: formDataCode(params)
    });
}

// 确认收货
export async function SetFinishOrder(params) {
    return request(`/${window.storeId}/Order/SetFinishOrder`, {
      method: 'POST',
      headers:{
        'Content-Type':"application/x-www-form-urlencoded",        
     },
     body: formDataCode(params)
    });
}

// 取消订单
export async function CancelOrder(params) {       
    return request(`/${window.storeId}/Order/CancelOrder`, {
      method: 'POST',
      headers:{
          'Content-Type':"application/x-www-form-urlencoded",        
      },
      body: formDataCode(params)
    });
}

// 保存调价信息
export async function ModifiedFee(params) {       
    return request(`/${window.storeId}/Order/ModifiedFee`, {
      method: 'POST',
      body: {
        ...params
      }
    });
}

// 导出订单
export async function ExportOrderList(params) {       
    return request(`/${window.storeId}/Order/ExportOrderList`, {
      method: 'POST',
      body: {
        ...params
      }
    });
}

